package gat.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 采购
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum EntrustOrderTypeEnum {

    SELL("出售", 1),
    BUY("购买", 2),

    ;

    private String description;
    private Integer code;
    public static EntrustOrderTypeEnum getByCode(String code) {
        for (EntrustOrderTypeEnum typeEnum : values()) {
            if (String.valueOf(typeEnum.getCode()).equals(code)) {
                return typeEnum;
            }
        }
        return null;
    }

}
